package mapper;

import DO.LogoDO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface LogoMapper {

    // 查询3个小时内的所有签到数据
    @Select("SELECT * FROM logo WHERE created_time >= NOW() - INTERVAL 3 HOUR ")
    List<LogoDO> logoBythree();

    @Insert("insert into logo (logo, created_time, class_id, uuid, end_time) VALUES (#{logo},#{createdTime},#{classId},#{uuid},#{endTime})")
    void save(LogoDO logoDO);

    @Select("SELECT * FROM logo WHERE created_time >= NOW() - INTERVAL 3 HOUR and class_id = #{#classId}")
    LogoDO getByClassId(Integer classId);

    @Select("select * from logo where id = #{logoId}")
    LogoDO getById(Integer logoId);
}
